Skip to content

fix: separate legal_status from judgment and ensure correct abstract source#52

Merged
sonesuke merged 1 commit intomainfrom
fix/screening-abstract-and-legal-status
Apr 5, 2026
Merged

fix: separate legal_status from judgment and ensure correct abstract source#52
sonesuke merged 1 commit intomainfrom
fix/screening-abstract-and-legal-status

Conversation

@sonesuke
Copy link
Copy Markdown
Owner

@sonesuke sonesuke commented Apr 5, 2026

Summary

  • Add legal_status column to screened_patents table to separately track patent legal status from relevance judgment
  • Fix abstract_text source: screening skill now explicitly requires fetch_patent.abstract_text instead of search snippet
  • Batch parallel fetch: screening now fetches up to 10 patents in parallel instead of sequential one-by-one

Problem

The screening skill was storing search result snippets as abstract_text instead of the official patent abstract from fetch_patent. Additionally, judgment conflated two separate concerns (relevance assessment and legal status) into a single field with no column to store legal_status from fetch_patent.

Root causes:

  1. screened_patents table had no legal_status column — fetched legal status was discarded
  2. SKILL.md did not explicitly distinguish abstract_text from snippet
  3. Tests only verified fetch_patent was invoked, not that results were correctly used
  4. Sequential per-patent processing was unnecessarily slow

Test plan

  • screening/functional-with-data PASS — verifies fetch_patent invoked, legal_status recorded, all patents screened
  • screening/triggering PASS
  • evaluating/functional PASS — verifies fetch_patent invoked
  • evaluating/triggering PASS
  • Remaining tests (claim-analyzing, prior-art-researching, investigation-reporting) — schema change propagated to all test fixtures

🤖 Generated with Claude Code

…source in screening

The screening skill was storing search snippets as abstract_text instead
of the official abstract from fetch_patent. This was caused by:

1. No explicit instruction to use fetch_patent.abstract_text (not snippet)
2. No legal_status column in screened_patents table, causing judgment
   to conflate relevance assessment with legal status
3. Tests only verified fetch_patent was invoked, not that results were used

Changes:
- Add legal_status column to screened_patents table
- Change judgment CHECK constraint to only allow relevant/irrelevant
- Update screening SKILL.md to explicitly distinguish abstract_text
  from snippet and batch fetch patents (up to 10 in parallel)
- Add CRITICAL warnings against using snippet as abstract
- Update record-screening.md with legal_status parameter
- Add test checks: all_patents_screened, legal_status_recorded,
  patent_fetch_invoked for both screening and evaluating
- Update all test fixtures to include legal_status in INSERT statements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonesuke sonesuke merged commit 6d0bb58 into main Apr 5, 2026
3 checks passed
@sonesuke sonesuke deleted the fix/screening-abstract-and-legal-status branch April 5, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants